Public Ret As Long ' Used as return value for aiXX function calls.
Public X As Single ' Temporary vector
Public Y As Single
Public Par1 As Long ' Transfer variables
Public Par2 As Long
Public PenaltyCoeff As Double ' Penalty coefficient value
Public NormType As Long ' Type of normalization
Public PenaltyType As Long ' Type of penalty function
Public InfListSize As Long ' Size of the influence list
Public InfListType As Long ' Type of the influence list
Public FileName As String
'
' The model!
'
Public Model As Long
Sub ReportError(ByVal err As Long)
If err <> AIERR_NO_ERROR Then
tOut = tOut + NL + "Error[" + CStr(err) + "]: "
If err = AIERR_PENALTY_ZERO Then tOut = tOut + "Penalty parameter was set to ZERO!"
If err = AIERR_NO_IO_VARIABLES Then tOut = tOut + "Input or Output variables are not properly defined! There must be at least one input and one ouput variable."
If err = AIERR_PENALTY_TOO_SMALL Then tOut = tOut + "The penalty parameter value is too small!"
If err = AIERR_EMPTY_ROW Then tOut = tOut + "An empty row was found in the model. There must be no empty rows in the model!"
If err = AIERR_EMPTY_COLUMN Then tOut = tOut + "An empty column was found in the model. There must be no empty rows in the model!"
If err = AIERR_EQUAL_COLUMN Then tOut = tOut + "All values in one columns are the same. The normalization is not possible!"
If err = AIERR_CSV_OPEN Then tOut = tOut + "Unable to open a CSV file!"
If err = AIERR_CSV_READ Then tOut = tOut + "Unable to read from CSV file. Wrong format!"
If err = AIERR_MEMORY_ALLOCATION Then tOut = tOut + "Unable to allocate new memory!"
If err = AIERR_INVALID_POINTER Then tOut = tOut + "Specified poitner (model) is invalid!"
If err = AIERR_INVALID_INDEX Then tOut = tOut + "Specified index is invalid - out of range!"
If err = AIERR_NO_FREE_ENTRY Then tOut = tOut + "There are no free entries in the model!"
End If
End Sub
Sub SetupStrings()
NL = Chr(13) + Chr(10)
T = Chr(9)
End Sub
Private Function IsHole(ByVal X As Single, ByVal Y As Single) As Boolean
r = Sqr(X * X + Y * Y)
If r > 0.7 Then
IsHole = False
Else
IsHole = True
End If
End Function
Private Sub ExcludeBtn_Click()
If Model = 0 Then
tOut = NL + "Load the model first!"
Else
Ret = 0
ExcludeMV.Show 1
If Ret <> 0 Then
tOut = NL + "Exclude Model Vectors:" + NL
Dim exclude As Long
If Ret = 1 Or Ret = 2 Then
exclude = 0 ' Ret = 2 ... include
If Ret = 1 Then exclude = 1
If ExcludeMV.Range = True Then
Dim first As Long
Dim last As Long
first = CStr(ExcludeMV.first)
last = CStr(ExcludeMV.last)
Par1 = aiExcludeModelVectorRange(Model, first, last, exclude)